package com.lantosec.hmrp.modules.workflow.enumeration;

/**
 * 流程状态
 */
public enum ProcessStatusEnum {
    //流程状态 完成 FINISH。进行中 PROCESSING，关闭 CLOSE
    FINISH("FINISH","完成"),
    PROCESSING("PROCESSING", "进行中"),
    CLOSE("CLOSE", "关闭");

    private String type;
    private String name;

    private ProcessStatusEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static ProcessStatusEnum getByType(String type) {
        for (ProcessStatusEnum item : ProcessStatusEnum.values()) {
            if (item.getType().equals(type)) {
                return item;
            }
        }
        return ProcessStatusEnum.FINISH;
    }
}
